package com.jin.springcloud.feign.controller;

import com.jin.springcloud.feign.service.FeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {

    @Autowired
    private FeignService feignService;

    @GetMapping("/hi")
    public String sayHi(@RequestParam(required = false, defaultValue = "anonymous") String name) {
        return feignService.sayHi(name);
    }

    @GetMapping("/test")
    public String test() {
        return "Eureka-feign-client server return the test info.";
    }
}
